#include "widget.h"
#include "ui_widget.h"

#include <iostream>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    if(ui->label->text() == "干嘛~")
        ui->label->setText("哎呦~");
    else
        ui->label->setText("干嘛~");
}

//void Widget::on_pushButton_2_clicked()
//{

//}

void Widget::on_moveLabel_pressed()
{
    QRect rect = this->geometry();
    std::srand(time(0));
    int x = rand() % rect.width();
    int y = rand() % rect.height();
    ui->moveLabel->move(x, y);
}
